package com.itheima.stock.pojo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 股票板块详情信息表
 * @TableName stock_block_rt_info
 */
@Data
public class StockBlockRtInfoNew implements Serializable {
    /**
     * 公司数量
     */
    private Integer companyNum;

    /**
     * 交易量
     */
    private Long tradeAmt;

    /**
     * 表示，如：new_blhy-玻璃行业
     */
    private String code;

    /**
     * 平均价格
     */
    private BigDecimal avgPrice;

    /**
     * 板块名称
     */
    private String name;

    /**
     * 当前日期（精确到秒）
     */
    private String curDate;

    /**
     * 交易金额
     */
    private BigDecimal tradeVol;

    /**
     * 涨跌幅
     */
    private BigDecimal updownRate;




    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StockBlockRtInfoNew other = (StockBlockRtInfoNew) that;
        return     (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getCompanyNum() == null ? other.getCompanyNum() == null : this.getCompanyNum().equals(other.getCompanyNum()))
                && (this.getAvgPrice() == null ? other.getAvgPrice() == null : this.getAvgPrice().equals(other.getAvgPrice()))
                && (this.getUpdownRate() == null ? other.getUpdownRate() == null : this.getUpdownRate().equals(other.getUpdownRate()))
                && (this.getTradeAmt() == null ? other.getTradeAmt() == null : this.getTradeAmt().equals(other.getTradeAmt()))
                && (this.getTradeVol() == null ? other.getTradeVol() == null : this.getTradeVol().equals(other.getTradeVol()))
                && (this.getCurDate() == null ? other.getCurDate() == null : this.getCurDate().equals(other.getCurDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCompanyNum() == null) ? 0 : getCompanyNum().hashCode());
        result = prime * result + ((getAvgPrice() == null) ? 0 : getAvgPrice().hashCode());
        result = prime * result + ((getUpdownRate() == null) ? 0 : getUpdownRate().hashCode());
        result = prime * result + ((getTradeAmt() == null) ? 0 : getTradeAmt().hashCode());
        result = prime * result + ((getTradeVol() == null) ? 0 : getTradeVol().hashCode());
        result = prime * result + ((getCurDate() == null) ? 0 : getCurDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", label=").append(code);
        sb.append(", blockName=").append(name);
        sb.append(", companyNum=").append(companyNum);
        sb.append(", avgPrice=").append(avgPrice);
        sb.append(", updownRate=").append(updownRate);
        sb.append(", tradeAmount=").append(tradeAmt);
        sb.append(", tradeVolume=").append(tradeVol);
        sb.append(", curTime=").append(curDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
